# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).                                                                                        # See COPYING for license details.
# See COPYING for license details.

pkgname=python-prance
_pkgname=${pkgname#python-}
pkgver=25.4.8.0
pkgrel=1
pkgdesc='Resolving Swagger/OpenAPI 2.0 and 3.0 Parser.'
url='https://pypi.org/project/prance/'
license=('MIT')
arch=('any')
depends=('python' 'python-chardet' 'python-ruamel-yaml' 'python-requests'
         'python-six' 'python-semver' 'python-packaging')
optdepends=('python-flex' 'python-click' 'python-pyicu'
            'python-openapi-spec-validator')
makedepends=('python-build' 'python-pip')
options=(!emptydirs)
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('fd69d10e53943e8447da5ac92de30f1932c14222f909f203d0fb80534d3659b18fb3324c88b2ed9f7c9a10e231a6e21c8e8d4eaf65529ff5e8d4e3170c749431')

build() {
  cd "$_pkgname-$pkgver"

  python -m build --wheel --outdir="$startdir/dist"
}

package() {
  cd "$_pkgname-$pkgver"

  pip install \
    --verbose \
    --disable-pip-version-check \
    --no-warn-script-location \
    --ignore-installed \
    --no-compile \
    --no-deps \
    --root="$pkgdir" \
    --prefix=/usr \
    --no-index \
    --find-links="file://$startdir/dist" \
    $_pkgname
}

